import React from 'react';
import ReactDOM from 'react-dom';

class Name extends React.Component {
    render() {
        return <h1>网站名称：{this.props.name}</h1>;
    }
}

class Url extends React.Component {
    render() {
        return <h1>网站地址1：{this.props.url}</h1>;
    }
}
class Nickname extends React.Component {
    render() {
        return <h1>网站小名：{this.props.nickname}</h1>;
    }
}

function App() {
    const element = <Nickname nickname="1Runoob"/>;
    return (
        <div>
            <Name name="菜鸟教程"/>
            <Url url="http://www.runoob.com"/>
            {element}
        </div>
    );
}

ReactDOM.render(
    <App/>,
    document.getElementById('root')
);
